<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width,user-scalable=0"/>
    <meta charset="UTF-8">
    <title>BD健身</title>
    <script src="__api__/js/fontSize.js"></script>
    <link rel="stylesheet" href="__api__/css/bootstrap.min.css">
    <link rel="stylesheet" href="__api__/css/reset.css">
    <link rel="stylesheet" href="__api__/css/my_main.css">
</head>
<body>
<div class="register">

    <div class="regTitle">
            <h2>修改密码</h2>
        </div>
    <div class="reg_form">

            <form action="#" class="form-horizontal" onsubmit="return false">
                <div class="form-group">
                    <div class="regText">
                        <p>旧密码</p>
                    </div>
                    <input type="password" name="pwd" class="form-control pw1" placeholder="请输入6~16位密码">
                </div>
                <div class="form-group">
                    <div class="regText">
                        <p>新密码</p>
                    </div>
                    <input type="password" name="newpwd" class="form-control pw2" placeholder="请输入6~16位密码">
                </div>
                <div class="form-group">
                    <div class="regText">
                        <p>确认新密码</p>
                    </div>
                    <input type="password" name="qpwd" class="form-control pw3" placeholder="请再次输入6~16位密码">
                </div>
                <div class="container">
                    <button class="btn btn-primary" id="sub"><span>确定</span></button>
                </div>



            </form>
        </div>



</div>
<script src="__assets__/js/jquery.min.js"></script>
<script src="__assets__/layui.js"></script>
<script type="text/javascript">
$(function(){
	var layer;
	layui.use('layer', function(){
		   layer = layui.layer;
		  
		  //layer.msg('hello');
		});     
	$('#sub').click(function(){
		 var url="__up__/api/userinfo/updatepassword";
		 var data= $("form").serialize();
		$.post(url,data,function(res){
			var obj=eval('('+ res +')');
			var status=obj.status;
			var info=obj.info;
			switch(status){
			case -1:
				layer.msg(info,{icon:5});
				break;
			case 100:
				layer.msg(info,{icon:5});
				break;
			case 200:
				layer.msg(info,{icon:5});
				break;
			case 300:
				layer.msg(info,{icon:5});
				break;
			case 1:
				layer.msg(info,{icon:6},function(){
					window.location.href=obj.data;
				});
				break;
			case 0:
				layer.msg(info,{icon:5});
				break;
			}
		})
	});
})



</script>

</body>
</html>